Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
Why am I am getting "Cannot find name 'function name' error"?

So I added this function below to my ts class:

 private get(iD: string): Promise <Function> => async () => {
        const tallConfig = await longCrudService.getHalf(iD);
        const stream: Stream = tallConfig.stream;
        const response = this.createUrl(tallConfig, stream);
        return response;
    }

But as soon as I add it, every other functions/Methods below it starts throwing this error: "Cannot find name 'function name'". Did I add it the wrong way?. I'm still trying to get a hold of typescript.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

private get = async (id: string): Promise<Function> => {

or

private get: (iD: string) => Promise<Function> = async (iD: string) => {
about 4 years ago · Juan Pablo Isaza Denunciar

0

What you are actually declaring here is a method. Declaring methods with arrow syntax goes like this:

private methodName = (param: ParamType): TypeOfReturnable => {
    // remember to return something of type TypeOfReturnable
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda